package com.jk.hearthstone.card.biology.hero;

import com.jk.hearthstone.card.arms.BaseArms;
import com.jk.hearthstone.card.biology.BaseBiology;
import com.jk.hearthstone.data.Desktop;
import com.jk.hearthstone.data.History;
import com.jk.hearthstone.enumeration.SkillType;

/**
 * 所有英雄的基类
 * @author jk
 */
public abstract class BaseHero extends BaseBiology implements Cloneable {
    public Integer skillCost = 2; //英雄技能耗费
    public SkillType skillType;
    public BaseArms arms = null; //英雄武器
    public Integer armor = 0; //护甲
    public Integer power; //水晶数量
    public Integer overloadPower; //过载水晶数

    public Boolean canSkill = true; //能否释放技能

    /**
     * 英雄技能
     * @param desktop 桌面环境
     * @param history 游戏历史
     */
    public abstract void skill(Desktop desktop, History history);

    /**
     * 带目标的英雄技能
     * @param desktop
     * @param history
     * @param target
     */
    public abstract void skill(Desktop desktop, History history,BaseBiology target);

    @Override
    public Object clone() throws CloneNotSupportedException {
        Object result =  super.clone();
        if(this.arms!=null){
            ((BaseHero)result).arms = (BaseArms) this.arms.clone();
        }
        return result;
    }
}
